import wx

class StatusMain(wx.StatusBar):
    
    def __init__(self, parent):
        wx.StatusBar.__init__(self, parent)
        self.SetFieldsCount(3)
        self.SetStatusWidths([-2, -2, 160])

        self.progress = wx.Gauge(self, -1, 100, style = wx.GA_SMOOTH)
        self.progress.Show(False)
        self.Reposition()
        
        self.Bind(wx.EVT_SIZE, self.OnSize)
        
    def OnSize(self, event):
        self.Reposition()
        
    def Reposition(self):
        rect = self.GetFieldRect(2)
        self.progress.SetPosition((rect.x, rect.y+1))
        self.progress.SetSize((rect.width, rect.height-2))